Skip to main content

Sending Messages & Response Details

Message Lifecycle

StepAction
1User submits text (or clicks a starter prompt)
2UI immediately appends a user bubble (optimistic update)
3Request sent to Chat API (POST /chat/send_message) with user token and active mode
4Middleware validates the token
5Backend orchestrates (MCP tool → LLM → internal Data Manager APIs)
6Response returned with text (+ optional visualization payload)
7Internal tool messages are filtered out — only user‑visible text is shown
8UI renders sanitized markdown + chart (if any) & auto‑scrolls to bottom

On the first message in a new conversation, the title is auto‑generated from the first six words of your message.

Tips for Effective Prompts

  • Be explicit about the data entity (e.g., "Show account balances by account name")
  • Ask for summaries or comparisons
  • If you want a list, start with: "List ..."; bullet formatting will improve readability
  • In Q&A mode, ask about platform features, configuration, or processes

Visualization Responses

Current implementation supports pie charts. A response qualifies when it includes:

{
"visualization_type": "pie",
"visualization_data": [
{ "account_name": "Operating", "available_balance": "12345.67" },
{ "account_name": "Reserves", "available_balance": "8901.23" }
]
}

Rules:

  • Numeric values are parsed as floats
  • Legend + percentage labels auto render
  • Up to 5 default colors rotate

More chart types are planned (see Feature Flags section).

Error Handling

If a send fails you receive a notification: "Failed to send message. Please try again." The original input is cleared currently; you can retype / paste.

Sanitization & Allowed HTML

Before display, markup passes through a custom markdown-to-HTML simplifier then DOMPurify with a very small allow‑list to prevent script injection.

Next: Conversation History & Management.